<?php
class CegosztalyComponent extends Component{
	
	function getunBindArray($hbtm = array('Gyujto', 'User')){
		//creating the unbind array for the osztaly model
		return(array('hasMany' => array('Bizonylat'), 'hasAndBelongsToMany' => $hbtm));
   }
	
	function getBindArray($cegId){
		return(array('hasOne' => array(
											'GyujtoOsztaly' => array(
																		'foreignKey' => false,
																		'type' => 'INNER',
																		'conditions' => array('GyujtoOsztaly.osztaly_id = Osztaly.id')
																		),
											'Gyujto' => array(
																		'foreignKey' => false,
																		'type' => 'INNER',
																		'conditions' => array(
																									'Gyujto.id = GyujtoOsztaly.gyujto_id',
																									'Gyujto.id' => $cegId
																									)
																	)
											)
						)
				 );
	}
}

?>